public class Test {
    public static void main(String[] args) {
        //创建链表
        MyLinkedList myLinkedList=new MyLinkedList();
        //头插演示
        myLinkedList.addFirst(1);
        myLinkedList.addFirst(2);
        myLinkedList.addFirst(3);
        myLinkedList.addFirst(4);
        //尾插演示
        myLinkedList.addLast(1);
        myLinkedList.addLast(1);
        myLinkedList.addLast(1);
        myLinkedList.addLast(1);
        myLinkedList.display();
        System.out.println("****************");

        //删除第一个值为key的节点
        myLinkedList.toRemove(2);
        myLinkedList.display();
        System.out.println("****************");

        //删除所有值为key的节点
        myLinkedList.removeAll(1);
        myLinkedList.display();
        System.out.println("****************");

        //指定位置插入演示
        myLinkedList.addIndex(1,0);
        myLinkedList.display();
        System.out.println("****************");

        //获取大小演示
        System.out.println("链表大小为"+myLinkedList.getSize());
        System.out.println("****************");

        //清空演示
        myLinkedList.clear();
        myLinkedList.display();
    }
}